package com.qqletter.request.oauth;

import java.util.TreeMap;
import com.qqletter.request.BaseRequest;
import com.qqletter.response.oauth.GetRequestTokenResponse;
import com.qqletter.utils.ParameterUtils;

/**
 * @author Devin.Hu
 * @date 2011-10-6
 * @version V1.0
 * @description
 */
public class GetRequestTokenRequest implements BaseRequest<GetRequestTokenResponse>{

	/** 回调URL 手机应用没有回调URL,请填上 oauth_callback=null **/
	private String oauth_callback;
	/** 你申请的appkey **/
	private String oauth_consumer_key;
	/** 随机串（32个字符长度）随机生成，只能使一次，与时间戳一起 防重放 **/
	private String oauth_nonce;
	/** oauth请求签名 oauth请求的签名，根据oauth协议中算法生成basestring 后，用appsecret 对basestring 经hmac_sha1生成的签名串**/
	private String oauth_signature;
	/** 签名方法（HMAC-SHA1） **/
	private String oauth_signature_method;
	/** 时间戳 你的请求当前时间戳 （你的服务器时间你定要准确，不然请求会被拒绝掉） **/
	private String oauth_timestamp;
	/** oauth版本号（填 1.0 ） **/
	private String oauth_version;

	public String getOauth_callback() {
		return oauth_callback;
	}

	public void setOauth_callback(String oauthCallback) {
		oauth_callback = oauthCallback;
	}

	public String getOauth_consumer_key() {
		return oauth_consumer_key;
	}

	public void setOauth_consumer_key(String oauthConsumerKey) {
		oauth_consumer_key = oauthConsumerKey;
	}

	public String getOauth_nonce() {
		return oauth_nonce;
	}

	public void setOauth_nonce(String oauthNonce) {
		oauth_nonce = oauthNonce;
	}

	public String getOauth_signature() {
		return oauth_signature;
	}

	public void setOauth_signature(String oauthSignature) {
		oauth_signature = oauthSignature;
	}

	public String getOauth_signature_method() {
		return oauth_signature_method;
	}

	public void setOauth_signature_method(String oauthSignatureMethod) {
		oauth_signature_method = oauthSignatureMethod;
	}

	public String getOauth_timestamp() {
		return oauth_timestamp;
	}

	public void setOauth_timestamp(String oauthTimestamp) {
		oauth_timestamp = oauthTimestamp;
	}

	public String getOauth_version() {
		return oauth_version;
	}

	public void setOauth_version(String oauthVersion) {
		oauth_version = oauthVersion;
	}

	@Override
	public Class<GetRequestTokenResponse> getResponseClass() {
		return GetRequestTokenResponse.class;
	}

	@Override
	public TreeMap<String, String> getTextParams(ParameterUtils paramUtils) throws Exception {
		paramUtils.addStringParam("oauth_callback", oauth_callback);
		paramUtils.addStringParam("oauth_consumer_key", oauth_consumer_key);
		paramUtils.addStringParam("oauth_nonce", oauth_nonce);
		paramUtils.addStringParam("oauth_signature", oauth_signature);
		paramUtils.addStringParam("oauth_signature_method", oauth_signature_method);
		paramUtils.addStringParam("oauth_timestamp", oauth_timestamp);
		paramUtils.addStringParam("oauth_version", oauth_version);
		return paramUtils.getParamsMap();
	}

}
